package com.bainuo.doctor.common.widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.EditText;

import com.bainuo.doctor.common.constant.Constant;
import com.bainuo.doctor.common.util.DisplayUtil;

/**
 * Created by luwei on 2017/10/11.
 */

public class CustomEditText extends EditText {


    public CustomEditText(Context context){
        super(context);
        setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize() + DisplayUtil.dip2px(context,Constant.TEXT_SIZE));
    }

    public CustomEditText(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        //设置修改字体大小\

//        try {
//            Field f = TextView.class.getDeclaredField("mCursorDrawableRes");
//            f.setAccessible(true);
//            f.set(this, R.drawable.cursor_color);
//        } catch (Exception ignored) {
//        }

        setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize() + DisplayUtil.dip2px(context,Constant.TEXT_SIZE) );
//        setTypeface(BaseApplication.getInstance().getTypeface());
    }

//    @Override
//    public void setTextSize(float size) {
//        super.setTextSize(size);
//    }
}
